import {
  Controller,
  Get, Query,
} from '@nestjs/common';
import { ApiOkResponse, ApiOperation, ApiTags } from '@nestjs/swagger';
import { SpecificationService } from './specification.service';
import { SpecificationAllResult } from "@/module/specification/specification.result";
import { AllDto } from "@/module/specification/specification.dto";

@Controller('/v1/specifications')
@ApiTags('Specification')
export class SpecificationV1Controller {
  constructor(private readonly specificationService: SpecificationService) {
  }

  @Get('/all')
  @ApiOperation({ summary: '全部' })
  @ApiOkResponse({ type: SpecificationAllResult, isArray: true })
  async all(@Query() query: AllDto): Promise<SpecificationAllResult[]> {
    const res = await this.specificationService.all(query);
    return res;
  }
}
